$(function(){ 
　　$.uitools.hidePageLoad();
	try {
		$('.form_datetime').datetimepicker({
		     format: 'yyyy-mm-dd hh:ii:ss',  
		     autoclose: true,  
		     forceParse: false,  
		     language: 'zh-CN'
		});
		$('.form_date').datetimepicker({
		    format: 'yyyy-mm-dd',  
		     weekStart: 1,  
		     autoclose: true,  
		     startView: 2,  
		     minView: 2,  
		     forceParse: false,  
		     language: 'zh-CN'  
		});
		$('.form_time').datetimepicker({
		    language:  'zh-CN',
		    weekStart: 1,
		    todayBtn:  1,	
			autoclose: 1,
			todayHighlight: 1,
			startView: 1,
			minView: 0,
			maxView: 1,
			forceParse: 0
		});
	} catch (e) {
	
	}
}); 
$.uitools = {};
$.uitools.hidePageLoad = function () {
    try {
        parent.hidePageLoad();
    } catch (e) {

    }
    try {
        hidePageLoad();
    } catch (e) {

    }
}
$.uitools.showLoading = function () {
    try {
    	parent.$(".layui-layer-iframe").showLoading();
    } catch (e) {

    }
    try {
    	$(".layui-layer-iframe").showLoading();
    } catch (e) {

    }
}

$.uitools.hideLoading = function () {
    try {
    	parent.$(".layui-layer-iframe").hideLoading();
    } catch (e) {

    }
}

Date.prototype.format = function(e) {
	var t = {
		"M+": this.getMonth() + 1,
		"d+": this.getDate(),
		"h+": this.getHours(),
		"m+": this.getMinutes(),
		"s+": this.getSeconds(),
		"q+": Math.floor((this.getMonth() + 3) / 3),
		S: this.getMilliseconds()
	};
	if(/(y+)/.test(e)) {
		e = e.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length))
	}
	for(var a in t) {
		if(new RegExp("(" + a + ")").test(e)) {
			e = e.replace(RegExp.$1, RegExp.$1.length == 1 ? t[a] : ("00" + t[a]).substr(("" + t[a]).length))
		}
	}
	return e
};
function msgShow(e, t, a) {
	$.messager.alert(e, t, a)
}
$.fn.showPageLoading = function(e) {
	this.find("div.div-page-mask-msg").remove();
	this.find("div.div-page-mask").remove();
	msg = "";
	var t = this;
	if (e) {
		t = document
	}
	var i = $(t).width();
	var a = $(t).height();
	var n = 0;
	var s = 0;
	if ($(this).css("position") != "absolute") {
		n = $(this).offset().left;
		s = $(this).offset().top
	}
	$('<div class="div-page-mask"></div>').css({
		display : "block",
		left : n,
		top : s,
		width : i,
		height : a
	}).appendTo(this);
	$('<div class="div-page-mask-msg"></div>').html(msg).appendTo(this).css({
		display : "block",
		left : (i - $("div.div-page-mask-msg", this).outerWidth()) / 2 + n,
		top : (a - $("div.div-page-mask-msg", this).outerHeight()) / 2 + s
	})
};
$.fn.hidePageLoading = function() {
	this.find("div.div-page-mask-msg").remove();
	this.find("div.div-page-mask").remove()
};
$.fn.showLoading = function(e) {
	if (window.frames.length != parent.frames.length) {
		if ($(parent.document).find("div.widget-box-overlay").length > 0) {
			return
		}
	}
	$(this).find(">div.widget-box-overlay").remove();
	var t = '<div class="widget-box-overlay"><span class="loading-icon"></span></div>';
	$(this).append(t);
	$(this).find("div.widget-box-overlay .close").on("click", function(e) {
		var t = $(this);
		t.closest("div.widget-box-overlay").remove()
	})
};
$.fn.hideLoading = function() {
	$(this).find(">div>i.fa-spin").html("");
	var e = this;
	$(e).find(">div.widget-box-overlay").remove()
};